<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <p>My name is {{ object.name }},{{ object.age }} years old this year</p>
        <p>My name is {{ obj.name }},{{ obj.age }} years old this year and I have {{ num }} money</p>
    </div>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <script>
        const {createApp,reactive,ref} = Vue;
        createApp({
            setup() {
                //只能接收对象
                const object = reactive({
                    name: "九转苍翎",
                    age: 18
                });
                //既能接收对象,也能接收基本类型
                const num = ref(100);
                const obj = ref({
                    name: "逆天而行",
                    age: 18
                })
                return {
                    object,
                    num,
                    obj
                }
            }
        }).mount("#app");
    </script>
</body>
</html>